mov $trampoline_end - trampoline_start,%ecx
rep movsb
- mov $0x90000,%esp
+ mov $bootsym_phys(early_stack),%esp
call cmdline_parse_early
/* Jump into the relocated trampoline. */
.globl trampoline_start, trampoline_end
trampoline_start:
#include "trampoline.S"
-#include "wakeup.S"
trampoline_end:
.text
mov %ax,%es
mov %ax,%ss
- /* Stack grows down from +0x3000. Initialise IDT and enable irqs. */
- mov $0x3000,%sp
+ /* Initialise stack pointer and IDT, and enable irqs. */
+ mov $bootsym(early_stack),%sp
lidt bootsym(rm_idt)
sti
#include "mem.S"
#include "edd.S"
#include "video.S"
+#include "wakeup.S"
+
+ .align 16
+ .fill PAGE_SIZE,1,0
+early_stack:
#include "video.h"
-/* Scratch space layout: +0x3000 to +0x4000. */
-#define modelist (0x3000) /* 2kB (256 entries) */
+/* Scratch space layout: trampoline_end to trampoline_end+0x1000. */
+#define modelist bootsym(trampoline_end) /* 2kB (256 entries) */
#define vesa_glob_info (modelist + 0x800) /* 1kB */
#define vesa_mode_info (vesa_glob_info + 0x400) /* 1kB */
.code16
-#undef wakesym
-/* Used in real mode, to cal offset in current segment */
#define wakesym(sym) (sym - wakeup_start)
+ .align 16
ENTRY(wakeup_start)
- wakeup_code_start = .
-
cli
cld
movw %cs, %ax
movw %ax, %ds
movw %ax, %ss # A stack required for BIOS call
- movw $wakesym(wakeup_stack), %sp
+ movw $wakesym(early_stack), %sp
pushl $0 # Kill dangerous flag early
popfl
mov $BOOT_DS, %eax
mov %eax, %ds
mov %eax, %ss
- mov $bootsym_phys(wakeup_stack), %esp
+ mov $bootsym_phys(early_stack), %esp
# check saved magic again
mov $sym_phys(saved_magic), %eax
bogus_saved_magic:
movw $0x0e00 + 'S', 0xb8014
jmp bogus_saved_magic
-
- .align 16
-wakeup_stack_begin: # Stack grows down
-
- .fill PAGE_SIZE,1,0
-wakeup_stack: # Just below end of first page in this section
-ENTRY(wakeup_end)